<!--section class="cta-section theme-bg-light py-5">
    <div class="container text-center single-col-max-width">

        <h2 class="heading">{{.app.subtitle}}</h2>
        <div class="intro">Welcome to my blog. Subscribe and get my latest blog post in your inbox.</div>
    </div>
</section-->

<section class="blog-list px-3 py-5 p-md-5">
    <div class="container single-col-max-width">
        {{range $k, $v := .posts}}
            <div class="item mb-5">
                <div class="row g-3 g-xl-0">
                    <div class="col-2 col-xl-3">
                        {{if ne $v.titleimg ""}}
                            <img class="img-fluid post-thumb " src="{{$v.titleimg}}" alt="image">
                        {{else}}
                            <img class="img-fluid post-thumb " src="/static/assets/images/blog/blog-post-thumb-1.jpg"
                                 alt="image">
                        {{end}}
                    </div>
                    <div class="col">
                        <h3 class="title mb-1"><a class="text-link" href="/article?id={{$v.id}}">{{$v.title}}</a>
                        </h3>
                        <div class="meta mb-1">
                            <span class="date">{{$v.pubdate}}</span>
                            {{range $k2,$v2 := $v.tags}}
                                <span class="date"><a href="/tag?id={{$v2.id}}">{{$v2.caption}}</a></span>
                            {{end}}
                        </div>
                        <div class="intro">{{$v.shortdesc}}...
                        </div>
                        <a class="text-link" href="/article?id={{$v.id}}">Read more &rarr;</a>
                    </div><!--//col-->
                </div><!--//row-->
            </div>
        {{end}}
        <nav class="blog-nav nav nav-justified my-5">
            {{if eq .currentpage 1 }}
                <a class="nav-link-prev nav-item nav-link d-none rounded" href="#">上一页<i
                            class="arrow-prev fas fa-long-arrow-alt-left"></i></a>
            {{else}}
                <a class="nav-link-prev nav-item nav-link rounded" href="/?p={{.currentpage| plus -1}}">上一页<i
                            class="arrow-prev fas fa-long-arrow-alt-left"></i></a>
            {{end}}
            {{if eq .currentpage .totalpage}}
                <a class="nav-link-next nav-item nav-link d-none rounded" href="#">下一页<i
                            class="arrow-next fas fa-long-arrow-alt-right"></i></a>
            {{else}}
                <a class="nav-link-next nav-item nav-link rounded" href="/?p={{.currentpage|plus 1}}">下一页<i
                            class="arrow-next fas fa-long-arrow-alt-right"></i></a>
            {{end}}

        </nav>

    </div>
</section>
